cmake_minimum_required(VERSION 3.12)
project(udpserver)

find_package(Boost  REQUIRED system  thread)
set(CMAKE_CXX_STANDARD 14)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME ON)
SET(USED_LIBS ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_REGEX_LIBRARY} )
message("CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}")
message("${Boost_LIBRARIES}")
if(CompilerName STREQUAL "g++")
    set(System_LIBRARIES ${System_LIBRARIES} pthread rt)
endif()
IF(Boost_FOUND)
    INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
    LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
ENDIF(Boost_FOUND)
add_executable(udpserver main.cpp)
target_link_libraries(udpserver ${Boost_LIBRARIES})